package com.mark.killy;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

import com.mark.killy.Utils.OnClickUtils;

public class activity_login_formActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //全屏
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
         WindowManager.LayoutParams.FLAG_FULLSCREEN);
        //隐藏标题栏
        ActionBar actionBar = getSupportActionBar();
        actionBar.hide();

        setContentView(R.layout.activity_login_form);

        //获取到login页面的按钮
        final Button  button =findViewById(R.id.and_lgoin);
        /**
         * 跳转至主页面
         */
        button.setOnClickListener(new View.OnClickListener() {
             //todo 登录跳转至主页面查看前端效果业务逻辑暂时搁置
              @Override
             public void onClick(View v) {
              if (OnClickUtils.isFastClick()) {
               Intent intent =new Intent();
               //禁止返回上一个页面
               intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK);
                //todo 测试期间跳转页面需根据需求进行改变
               intent.setClass(activity_login_formActivity.this,Pagecontrol.class);
               activity_login_formActivity.this.startActivity(intent);

                    }
              }

        });


        /**
         * 跳转至注册页面
         */

        TextView  register=(TextView)findViewById(R.id.register_size);
        register.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ComponentName componentname = new ComponentName(activity_login_formActivity.this,activity_signup_formActivity.class);
                Intent intent = new Intent();
                intent.setComponent(componentname);
                startActivity(intent);
            }
        });






    }
}
